package com.pearl.jacksoncore.demo.databind.anno;

import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.deser.ValueInstantiator;
/**
 * @author TD
 * @version 1.0
 * @date 2024/3/28
 */
public class MyValueInstantiator extends ValueInstantiator.Base {
    public MyValueInstantiator() {
        super(Object.class);
    }

    @Override
    public String getValueTypeDesc() {
        return ValueInstantiatorVO.class.getName();
    }

    @Override
    public boolean canCreateUsingDefault() { return true; }

    @Override
    public ValueInstantiatorVO createUsingDefault(DeserializationContext ctxt) {
        return new ValueInstantiatorVO("哈哈", 3);
    }
}
